﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace StripeOne.Core.Tools
{
    public static class XmlExtensions
    {
        public static string GetElement(this XElement element, string name)
        {
            var result = "";
            var currentElement = element.Element(name);
            return currentElement != null ? currentElement.Value : result;
        }

        public static string GetAttribute(this XElement element, string name)
        {
            var result = "";
            var currentElement = element.Attribute(name);
            return currentElement != null ? currentElement.Value : result;
        }
    }
}
